<?php
/**
 * $Id: mod_virtuemart_featureprod_xhtml.php 3 2010-04-05 10:01:57Z webbochsant $
 *  @package	Joomla
 *  @author Daniel Eliasson
* 	@copyright	Copyright (C) 2010 Stilero. All rights reserved.
* 	@license	GNU/GPL, see LICENSE.php
* 	Joomla! is free software. This version may have been modified pursuant
* 	to the GNU General Public License, and as distributed it includes or
* 	is derivative of works licensed under the GNU General Public License or
* 	other free or open source software licenses.
*/

// no direct access
defined('_JEXEC') or die('Restricted access'); 

// Include the syndicate functions only once
require_once (dirname(__FILE__).DS.'helper.php');

// Cachefunctions, needs to be removed. 
if ($params->get('sqlcache')){
	$cache =& JFactory::getCache('mod_virtuemart_featureprod_xhtml');
	$cache->setCaching( 1 );
	$cache->setLifeTime($params->get('sqlcachetime', 900));
	$method = array('modVirtuemartFeatureProductsXHTMLHelper', 'getProducts');
	$list = $cache->call($method, $params);
	$cache->setCaching( 0 );
}else{
	$list = modVirtuemartFeatureProductsXHTMLHelper::getProducts($params);
}


// check if any results returned
$items = count($list);
if (!$items) {
	return;
}

$layout = $params->get('layout', 'default');
$path = JModuleHelper::getLayoutPath('mod_virtuemart_featureprod_xhtml', $layout);
if (file_exists($path)) {
	require($path);
}


?>